//
//  LKOpenSuborainateCheckStateViewController.m
//  Mideleague_Agent
//
//  Created by Zhiwang on 2020/6/23.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKOpenSuborainateCheckStateViewController.h"
#import "LKUFPictureRow.h"
#import "LKUFPictureRowCell.h"
#import "LKUFOpenShopHeaderRow.h"
#import "LKUFOpenShopHeaderRowCell.h"
#import "LKUFOpenShopBottomButtonRow.h"
#import "LKUFOpenShopBottomButtonRowCell.h"
#import "LKOpenSubordinateUploadImageViewController.h"
#import "LKOpenSubordinateRateSettingViewController.h"
#import "LKMyCustomHeaderRow.h"
#import "LKMyCustomHeaderRowCell.h"
#import "LKOpenSuborainateCheckStateOverViewController.h"
@interface LKOpenSuborainateCheckStateViewController ()
@property(nonatomic,strong)UFFormView *formview;
@property(nonatomic,copy)NSString *hadSetting;
@property(nonatomic,copy)NSString *pictruehadSetting;
@property(nonatomic,strong)NSMutableArray *levelArra;
@property(nonatomic,strong)UFSection *section;
@end

@implementation LKOpenSuborainateCheckStateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"代理审核";
    self.hadSetting = @"";
    self.pictruehadSetting = @"";
//    self.inforModel = [[LKMySuboridateOpenInforModel alloc] init];
//    self.inforModel.agent_mode = @"0";
    [self setNavgationRightBtn];
    [self createCheckFormView];
    [self getMyAgentInformationData];
    // Do any additional setup after loading the view.
}
-(void)setNavgationRightBtn{
    WS(weakSelf)
    LKBaseButton *rightBtn = [LKBaseButton buttonWithFrame:CGRectMake(0, 0, 64, 24) type:UIButtonTypeCustom title:@"审核动态" titleColor:COLOR_HEX(0x333333) layercorne:13 font:[UIFont fontWithName:@"PingFangSC-Regular" size: 16] backgroudColor:[UIColor clearColor] AndActionBlock:^(UIButton * _Nonnull btn) {
        LKOpenSuborainateCheckStateOverViewController *vc = [[LKOpenSuborainateCheckStateOverViewController alloc] init];
        vc.uid = weakSelf.inforModel.Id;
        [self.navigationController pushViewController:vc animated:YES];
    }];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
}
/// 创建表单view的设置
-(void)createCheckFormView{
        WS(weakSelf)
    if ([self.inforModel.upid isEqualToString:[LKUserInforTool account].uid]) {
        self.formview = [UFFormView makeFormView:^(UFFormViewMaker * _Nonnull make) {
            make
            .registerRow([LKUFOpenShopHeaderRow class], [LKUFOpenShopHeaderRowCell class])
            .registerRow([LKUFPictureRow class], [LKUFPictureRowCell class])
            .registerRow([LKUFOpenShopBottomButtonRow class], [LKUFOpenShopBottomButtonRowCell class])
            .registerRow([LKMyCustomHeaderRow class], [LKMyCustomHeaderRowCell class])
            .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
                make
                .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
                   make
                    .width(WIDTH/2)
                    .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                    .color(labelBlackColor)
                    .textAlignment(NSTextAlignmentLeft);
                }])
                .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
                    make
                    .textAlignment(NSTextAlignmentRight)
                    .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                    .color(labelBlackColor);
                }])
                .addRowWithBlock(^__kindof UFRow * _Nonnull{
                    LKMyCustomHeaderRow *row = [[LKMyCustomHeaderRow alloc] init];
                    row.height = 120;
                    row.inforModel = weakSelf.inforModel;
                    return row;
                })
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.Id)
                    .title(@"代理ID");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.agent_name)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_name = value;
                    })
                    .title(@"代理名称");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.agent_jiancheng)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_jiancheng = value;
                    })
                    .title(@"代理简称");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.user_phone)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_phone = value;
                    })
                    .title(@"用户手机号");
                }])
                .addRow([UFPickerViewRow makePickerViewRow:^(UFPickerViewRowMaker * _Nonnull make) {
                    make
                    .itemArray(@[@"个人",@"企业"])
                    .placeholder(@"请选择")
                    .title(@"代理类型")
                    .value(weakSelf.inforModel.level_agent_mode)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.level_agent_mode = value;
                        if ([value isEqualToString:@"个人"]) {
                            weakSelf.inforModel.agent_mode = @"0";
                        }else{
                            weakSelf.inforModel.agent_mode = @"1";
                        }
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator)
                    .height(RowHeightDefault);
                }])
                .addRow([UFPickerViewRow makePickerViewRow:^(UFPickerViewRowMaker * _Nonnull make) {
                    make
                    .itemArray(self.levelArra)
                    
                    .placeholder(@"请选择")
                    .title(@"代理级别")
                    .value([NSString backSuboradinateTitleAccoringType:weakSelf.inforModel.agent_type])
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.hadSetting = @"已设置";
                        weakSelf.inforModel.agent_type = [NSString backSuboradinateTypeAccoringTitle:value];
                        [weakSelf.formview removeFromSuperview];
                        [weakSelf createCheckFormView];
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator)
                    .height(RowHeightDefault);
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .title(@"支付费率")
                    .value(weakSelf.hadSetting)
                    .rowDidSelected(^(__kindof UFRow * _Nonnull row) {
                        weakSelf.hadSetting = @"已设置";
                        LKOpenSubordinateRateSettingViewController *vc = [[LKOpenSubordinateRateSettingViewController alloc] init];

                        vc.inforModel = weakSelf.inforModel;
                        vc.modelBlock = ^(LKMySuboridateOpenInforModel * _Nullable model) {
                            weakSelf.inforModel = model;
                            [weakSelf.formview removeFromSuperview];
                            [weakSelf createCheckFormView];
                        };
                        [weakSelf.navigationController pushViewController:vc animated:YES];
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator);
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .placeholder(@"请上传资料照片")
                    .height(RowHeightDefault)
                    .value(weakSelf.pictruehadSetting)
                    .accessoryType(UFRowAccessoryDisclosureIndicator)
                    .rowDidSelected(^(__kindof UFRow * _Nonnull row) {
                        LKOpenSubordinateUploadImageViewController *vc = [[LKOpenSubordinateUploadImageViewController alloc] init];
                        vc.inforModel = weakSelf.inforModel;
                        vc.modelBlock = ^(LKMySuboridateOpenInforModel * _Nullable model) {
                             weakSelf.inforModel = model;
                             if (model.id_card_img.length != 0 || model.back_id_card_img.length != 0 || model.hand_id_card_img.length != 0 || model.bussiness_img.length != 0 || model.agreement_img1.length != 0 || model.agreement_img2.length != 0 || model.agreement_img3.length != 0 || model.agreement_img4.length != 0) {
                                 self.pictruehadSetting = @"已设置";
                             }
                             [weakSelf.formview removeFromSuperview];
                             [weakSelf createCheckFormView];
                         };
                         [weakSelf.navigationController pushViewController:vc animated:YES];
                    })
                    .title(@"资料照片(非必传)");
                }])
                .addRow([UFAreaPickerRow makeAreaPickerRow:^(UFAreaPickerRowMaker * _Nonnull make) {
                    make
                    .areaSeparator(@",")
                    .height(RowHeightDefault)
                    .title(@"所在地址")
                    .value([NSString stringWithFormat:@"%@%@%@",[NSString judegeIsNullAndTransform:weakSelf.inforModel.province],[NSString judegeIsNullAndTransform:weakSelf.inforModel.city],[NSString judegeIsNullAndTransform:weakSelf.inforModel.county]])
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        NSArray *addressArray = [value componentsSeparatedByString:@","];
                        if (addressArray.count == 3) {
                            weakSelf.inforModel.province = addressArray[0];
                            weakSelf.inforModel.city = addressArray[1];
                            weakSelf.inforModel.county = addressArray[2];
                        }else{
                            weakSelf.inforModel.province = addressArray[0];
                            weakSelf.inforModel.county = addressArray[1];
                            if ([weakSelf.inforModel.province containsString:@"市"]) {
                                weakSelf.inforModel.county = addressArray[1];
                                weakSelf.inforModel.city = [weakSelf.inforModel.province mutableCopy];
                                weakSelf.inforModel.province = [[weakSelf.inforModel.province componentsSeparatedByString:@"市"] firstObject];
                            }
                        }
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator);
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.address)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.address = value;
                    })
                    .title(@"详细地址");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    
                    .placeholder(@"请输入推荐人名称")
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.referrer)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.referrer = value;
                    })
                    .title(@"推荐人(非必传)");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    
                    .placeholder(@"请输入备注")
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.user_note)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.user_note = value;
                    })
                    .title(@"备注(非必传)");
                }])
                .addRowWithBlock(^__kindof UFRow * _Nonnull{
                    LKUFOpenShopBottomButtonRow *buttonRow = [[LKUFOpenShopBottomButtonRow alloc] init];
                    buttonRow.height = 250;
                    buttonRow.buttonTitle = @"提交";
                    buttonRow.actionBlock = ^{
                         NSDictionary *param = [weakSelf.inforModel properties_aps];
                          NSMutableDictionary *mutableDic = [[NSMutableDictionary alloc] initWithDictionary:param];
                          [mutableDic setObject:weakSelf.inforModel.Id forKey:@"agent_id"];
                          [mutableDic setObject:@"编辑" forKey:@"msg"];
                          [mutableDic setObject:@"0" forKey:@"status"];
                          [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:MySuboradinateCheckEditUrl header:[LKUserInforTool account].token parameters:mutableDic progress:^(NSProgress * _Nullable progress) {
                              
                          } success:^(BOOL isSuccess, id  _Nullable responseObject) {
                              if ([responseObject[@"code"] isEqualToString:@"success"]) {
                               [SVProgressHUD showInfoWithStatus:responseObject[@"msg"]];
                                  [weakSelf.navigationController popViewControllerAnimated:YES];
                                                          [[NSNotificationCenter defaultCenter] postNotificationName:@"mangerMyOpenSubordinateReload" object:nil];
                              }else{
                                  [SVProgressHUD showInfoWithStatus:responseObject[@"msg"]];
                              }
                          } failure:^(NSString * _Nullable errorMessage) {
                              
                          }];
                    };
                    return buttonRow;
                });
            }])
            .addToSuperView(self.view);
        }];
    }else{
        self.formview = [UFFormView makeFormView:^(UFFormViewMaker * _Nonnull make) {
            make
            .registerRow([LKUFOpenShopHeaderRow class], [LKUFOpenShopHeaderRowCell class])
            .registerRow([LKUFPictureRow class], [LKUFPictureRowCell class])
            .registerRow([LKUFOpenShopBottomButtonRow class], [LKUFOpenShopBottomButtonRowCell class])
            .registerRow([LKMyCustomHeaderRow class], [LKMyCustomHeaderRowCell class])
            .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
                make
                .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
                   make
                    .width(WIDTH/2)
                    .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                    .color(labelBlackColor)
                    .textAlignment(NSTextAlignmentLeft);
                }])
                .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
                    make
                    .textAlignment(NSTextAlignmentRight)
                    .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                    .color(labelBlackColor);
                }])
                .addRowWithBlock(^__kindof UFRow * _Nonnull{
                    LKMyCustomHeaderRow *row = [[LKMyCustomHeaderRow alloc] init];
                    row.height = 120;
                    row.inforModel = weakSelf.inforModel;
                    return row;
                })
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.Id)
                    .title(@"代理ID");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.agent_name)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_name = value;
                    })
                    .title(@"代理名称");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.agent_jiancheng)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_jiancheng = value;
                    })
                    .title(@"代理简称");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.user_phone)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.agent_phone = value;
                    })
                    .title(@"用户手机号");
                }])
                .addRow([UFPickerViewRow makePickerViewRow:^(UFPickerViewRowMaker * _Nonnull make) {
                    make
                    .itemArray(@[@"个人",@"企业"])
                    .editable(NO)
                    .placeholder(@"请选择")
                    .title(@"代理类型")
                    .value(weakSelf.inforModel.level_agent_mode)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.level_agent_mode = value;
                        if ([value isEqualToString:@"个人"]) {
                            weakSelf.inforModel.agent_mode = @"0";
                        }else{
                            weakSelf.inforModel.agent_mode = @"1";
                        }
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator)
                    .height(RowHeightDefault);
                }])
                .addRow([UFPickerViewRow makePickerViewRow:^(UFPickerViewRowMaker * _Nonnull make) {
                    make
                    .itemArray(self.levelArra)
                    .editable(NO)
                    .placeholder(@"请选择")
                    .title(@"代理级别")
                    .value([NSString backSuboradinateTitleAccoringType:weakSelf.inforModel.agent_type])
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.hadSetting = @"已设置";
                        weakSelf.inforModel.agent_type = [NSString backSuboradinateTypeAccoringTitle:value];
                        [weakSelf.formview removeFromSuperview];
                        [weakSelf createCheckFormView];
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator)
                    .height(RowHeightDefault);
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .title(@"支付费率")
                    .value(weakSelf.hadSetting)
                    .rowDidSelected(^(__kindof UFRow * _Nonnull row) {
                        weakSelf.hadSetting = @"已设置";
                        LKOpenSubordinateRateSettingViewController *vc = [[LKOpenSubordinateRateSettingViewController alloc] init];
                        vc.isCheckStatu = YES;
                        vc.inforModel = weakSelf.inforModel;
                        vc.modelBlock = ^(LKMySuboridateOpenInforModel * _Nullable model) {
                            weakSelf.inforModel = model;
                            [weakSelf.formview removeFromSuperview];
                            [weakSelf createCheckFormView];
                        };
                        [weakSelf.navigationController pushViewController:vc animated:YES];
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator);
                }])
            .addRowWithBlock(^__kindof UFRow * _Nonnull{
                    LKUFPictureRow *pictureRow = [[LKUFPictureRow alloc] init];
                    pictureRow.headerTitle = @"资料照片";
                    pictureRow.pictureNumbers = 8;
                    pictureRow.picturesArray = [[NSMutableArray alloc] initWithArray:                @[[NSString judegeIsNullAndTransform:weakSelf.inforModel.id_card_img],[NSString judegeIsNullAndTransform:weakSelf.inforModel.back_id_card_img],[NSString judegeIsNullAndTransform:weakSelf.inforModel.hand_id_card_img],[NSString judegeIsNullAndTransform:weakSelf.inforModel.bussiness_img],[NSString judegeIsNullAndTransform:weakSelf.inforModel.agreement_img1],[NSString judegeIsNullAndTransform:weakSelf.inforModel.agreement_img2],[NSString judegeIsNullAndTransform:weakSelf.inforModel.agreement_img3],[NSString judegeIsNullAndTransform:weakSelf.inforModel.agreement_img4]]];;
                    pictureRow.titlesPlaceArray = @[@"+身份证正面照",@"+身份证背面照",@"+手持身份证正面照",@"+营业执照",@"+合同第一页",@"+合同第二页",@"+合同第三页",@"+合同第四页"];
                    pictureRow.height = 450;
                    return pictureRow;
                })
                .addRow([UFAreaPickerRow makeAreaPickerRow:^(UFAreaPickerRowMaker * _Nonnull make) {
                    make
                    .areaSeparator(@",")
                    .editable(NO)
                    .height(RowHeightDefault)
                    .title(@"所在地址")
                    .value([NSString stringWithFormat:@"%@%@%@",[NSString judegeIsNullAndTransform:weakSelf.inforModel.province],[NSString judegeIsNullAndTransform:weakSelf.inforModel.city],[NSString judegeIsNullAndTransform:weakSelf.inforModel.county]])
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        NSArray *addressArray = [value componentsSeparatedByString:@","];
                        if (addressArray.count == 3) {
                            weakSelf.inforModel.province = addressArray[0];
                            weakSelf.inforModel.city = addressArray[1];
                            weakSelf.inforModel.county = addressArray[2];
                        }else{
                            weakSelf.inforModel.province = addressArray[0];
                            weakSelf.inforModel.county = addressArray[1];
                            if ([weakSelf.inforModel.province containsString:@"市"]) {
                                weakSelf.inforModel.county = addressArray[1];
                                weakSelf.inforModel.city = [weakSelf.inforModel.province mutableCopy];
                                weakSelf.inforModel.province = [[weakSelf.inforModel.province componentsSeparatedByString:@"市"] firstObject];
                            }
                        }
                    })
                    .accessoryType(UFRowAccessoryDisclosureIndicator);
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.address)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.address = value;
                    })
                    .title(@"详细地址");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .placeholder(@"请输入推荐人名称")
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.referrer)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.referrer = value;
                    })
                    .title(@"推荐人(非必传)");
                }])
                .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                    make
                    .editable(NO)
                    .placeholder(@"请输入备注")
                    .height(RowHeightDefault)
                    .value(weakSelf.inforModel.user_note)
                    .valueDidChanged(^(__kindof UFRow * _Nonnull row, NSString * _Nonnull value) {
                        weakSelf.inforModel.user_note = value;
                    })
                    .title(@"备注(非必传)");
                }]);
            }])
            .addToSuperView(self.view);
        }];
    }

        [self.formview mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.view);
            make.top.equalTo(self.view.mas_top).offset(NAVIGATION_BAR_HEIGHT);
            make.bottom.equalTo(self.view);
        }];
}
/// 获取代理的详情数据
-(void)getMyAgentInformationData{
    NSDictionary *param = @{@"id":self.uid,@"token":[LKUserInforTool account].token};
    [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodGET serverUrl:ServerlUrl apiPath:MySuboradinateCheckUrl header:[LKUserInforTool account].token parameters:param progress:^(NSProgress * _Nullable progress) {
        
    } success:^(BOOL isSuccess, id  _Nullable responseObject) {
        
        if ([responseObject[@"code"] isEqualToString:@"success"]) {
            self.inforModel = [LKMySuboridateOpenInforModel modelWithDictionary:responseObject[@"data"]];
            if (self.inforModel.ali_rate.length != 0 ) {
                self.hadSetting = @"已设置";
            }
            if (self.inforModel.id_card_img.length != 0 || self.inforModel.back_id_card_img.length != 0 || self.inforModel.hand_id_card_img.length != 0 || self.inforModel.bussiness_img.length != 0 || self.inforModel.agreement_img1.length != 0 || self.inforModel.agreement_img2.length != 0 || self.inforModel.agreement_img3.length != 0 || self.inforModel.agreement_img4.length != 0) {
                self.pictruehadSetting = @"已设置";
            }
            [self.formview removeFromSuperview];
            [self createCheckFormView];
        }else{
            [SVProgressHUD showInfoWithStatus:responseObject[@"msg"]];
        }
        
    } failure:^(NSString * _Nullable errorMessage) {
        
    }];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
